export default {
  form_ods2sale_wizard: {
    _odoo_model: 'ir.ui.view',
    model: 'fp.ods2sale.wizard',
    type: 'form',

    arch: {
      buttons: [
        {
          name: 'create_sale_order',
          string: '创建销售订单',
          type: 'object',
          btn_type: 'primary'
        }
      ]
    },

    fields: {
      company_id: { readonly2: 1 },

      ods_line_ids: {
        string: '原明细行',
        widget: 'x2many_tree',
        views: {
          tree: {
            fields: {
              order_partner_id: {},
              order_num: {},
              sequence: {},
              // product_id: {},
              // product_categ_id: {},
              product_categ_code: {},
              product_categ_name: {},
              product_code: {},
              product_name: {},
              product_spec: {},
              uom_name: {},
              tax_id: {},
              tax_ratio: {},

              quantity: {},
              price_unit: {},

              amount_untaxed: {},
              amount_tax: {},
              amount_total: {}
            }
          },
          form: {
            fields: {
              order_partner_id: {},
              order_num: {},
              // product_id: {},
              // product_categ_id: {},

              product_categ_code: {},
              product_categ_name: {},
              product_code: {},
              product_name: {},
              product_spec: {},
              uom_name: {},
              tax_id: {},
              tax_ratio: {},

              quantity: {},
              price_unit: {},

              amount_untaxed: {},
              amount_tax: {},
              amount_total: {}
            }
          }
        }
      },

      line_ids: {
        string: '目标明细行',
        widget: 'x2many_tree',
        views: {
          tree: {
            fields: {
              order_partner_id: {},
              order_num: {},
              sequence: {},
              product_id: {},
              product_categ_id: {},

              product_categ_code: {},
              product_categ_name: {},
              product_code: {},
              product_name: {},

              product_spec: {},
              uom_name: {},

              tax_id: {},
              tax_ratio: {},

              quantity: {},
              price_unit: {},
              amount_discount: {},
              amount_untaxed: {},
              amount_tax: {},
              amount_total: {}
            }
          },
          form: {
            fields: {
              // order_partner_id: {},
              order_num: {},
              sequence: {}
              // // product_id: {},
              // // product_categ_id: {},
              // product_categ_code: {},
              // product_categ_name: {},
              // product_code: {},
              // product_name: {},
              // product_spec: {},
              // uom_name: {},
              // tax_id: {},
              // tax_ratio: {},
              // quantity: {},
              // price_unit: {},
              // amount_untaxed: {},
              // amount_tax: {},
              // amount_total: {}
            }
          }
        }
      }
    }
  },

  action_ods_to_sale_order: {
    _odoo_model: 'ir.actions',
    name: 'ods to sale',
    type: 'ir.actions.act_window',
    res_model: 'fp.ods2sale.wizard',
    domain: [],
    context: {
      active_model: 'fp.ods.sale.order'
    },
    views: {
      form: 'form_ods2sale_wizard'
    }
  }
}
